@extends('layout')
@section('titulo')
Potreros
@stop
@section('content')
<style> 
.modal-header-default {
  color:#fff;
    padding:9px 15px;
    border-bottom:1px solid #eee;
    background-color: #009966;
    -webkit-border-top-left-radius: 5px;
    -webkit-border-top-right-radius: 5px;
    -moz-border-radius-topleft: 5px;
    -moz-border-radius-topright: 5px;
     border-top-left-radius: 5px;
     border-top-right-radius: 5px;
}

</style>


<div class="panel panel-success">
      <div class="panel-heading">
      <h3><left><a href = "#"><a class="glyphicon glyphicon-user text-success"></a></left>Lista de Clientes-Proveedores</h3> 
      </div>
    </div>

<div class="panel panel-success">
      <div class="input-group"> <span class="input-group-addon "><span class="glyphicon glyphicon-search"></span> Buscar</span>

    <input name="filter" id="filter" type="text" class="form-control" placeholder="¿Qué desea buscar?"></div>
      <div class="panel-body">
        <table id="grupos" class="table table-striped table-hover display display nowrap">
   </div> 
        <table class="table table-hover">
        <thead>
          <tr>
            <Th> Cliente </ th>
             <Th> Nombre  </ th>
               <Th> Ruc  </ th>
                <Th> Direccion </ th>

             <Th> Acciones </ th>

          </tr>
        </thead>
        <tbody>
          @foreach($cliente_proveedor as $clienteproveedor)
            <tr>
           <td> {{$clienteproveedor->cliente}} </td>
           <td> {{$clienteproveedor->nombre}} </td> 
            <td> {{$clienteproveedor->ruc}} </td> 
            <td> {{$clienteproveedor->direccion}} </td> 

              <td>
               <a href="clienteproveedor/{{$clienteproveedor->id}}"><span class="label label-info">Ver</span></a>
               <a href="{{route('clienteproveedor.edit', $clienteproveedor->id)}}"><span class="label label-success">editar</span></a>
                <br>
                <br>
               <a>{{ Form::open(array('url' => 'clienteproveedor/'.$clienteproveedor->id, 'method'=> 'delete')) }}
               {{ Form::submit('Eliminar',  array('class' => "btn btn-danger"))}}
               {{ Form::close() }}</a>
               </td>
            </tr>
         
          @endforeach
                </tbody>


      </table>
  
        <a href="{{URL::to('clienteproveedor/create')}}"><button class="btn btn-primary" data-toggle="modal" data-target="#crear"><span class="glyphicon glyphicon-plus"></span> Agregar Insumo</button></a>
      </div>

    </div>
   {{$cliente_proveedor->links()}} 

   <script type="text/javascript">
    $(document).ready(function() {
    $('#cliente_proveedor').dataTable({
      "dom": 'Rlfrtip',
        "language": {
            "sProcessing":     "Procesando...",
        "sLengthMenu":     "Mostrar _MENU_ registros",
        "sZeroRecords":    "No se encontraron resultados",
        "sEmptyTable":     "Ningún dato disponible en esta tabla",
        "sInfo":           "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",
        "sInfoEmpty":      "Mostrando registros del 0 al 0 de un total de 0 registros",
        "sInfoFiltered":   "(filtrado de un total de _MAX_ registros)",
        "sInfoPostFix":    "",
        "sSearch":         "Buscar:",
        "sUrl":            "",
        "sInfoThousands":  ",",
        "sLoadingRecords": "Cargando...",
        "oPaginate": {
            "sFirst":    "Primero",
            "sLast":     "Último",
            "sNext":     "Siguiente",
            "sPrevious": "Anterior"
              },
              }
    } );
    var table = $('#cliente_proveedor').DataTable();
 
  $('#filter').on( 'keyup', function () {
    table.search( this.value ).draw();
  } );
});
</script>
@stop